//
// Created by shao.liming on 2/2/2018.
//

#include <iostream>
#include "E247.h"

bool E247::isRotation(std::string a, std::string b) {
    if (a.empty() && b.empty())
        return true;

    if (a.size() != b.size())
        return false;

    std::string str = b + b;

    return str.find(a) != 0;
}

void E247::test() {
    std::string a = "12345";
    std::string b = "45123";
    std::cout << "a:" << a << " & b:" << b << std::endl;

    std::cout << "a & b " << (isRotation(a, b)?"are rotation.":"are not roration.");

}
